import java.io.PrintStream;
import java.util.List;
import java.util.Scanner;

public class FindPlayerCommand implements MenuCommand{

    private static final String NAME = "Press 2 for Find Players";
    private PrintStream printStream;
    private List<Player> players;

    public void act() {
        printStream.println("Enter a player name");
        Scanner input  = new Scanner(System.in);
        String playerName = input.nextLine();
        int playerNumber = input.nextInt();

        for(Player player : players) {
            if (playerName.equals(player.getName()) && playerNumber == player.getNumber()) {
                System.out.println("The player you have chosen: " + player.toString());
            }
        }
    }

    @Override
    public String toString() {
        return NAME;
    }
}
